package com.xxhui.custombardemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import com.xxhui.custombardemo.Interface.CustomBarClickListener;
import com.xxhui.custombardemo.View.CustomBar;

public class MainActivity extends AppCompatActivity {

    private CustomBar bar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        bar = (CustomBar) findViewById(R.id.customBar);
        bar.setClickListener(new CustomBarClickListener() {
            @Override
            public void leftClick() {
                Toast.makeText(MainActivity.this , "  说好的返回呢？\n更多:我又回来拉！",Toast.LENGTH_SHORT).show();
                bar.setButtonVisible(CustomBar.RIGHT_BUT_ID,true);
            }

            @Override
            public void rightClick() {
                Toast.makeText(MainActivity.this , "不小心隐藏自己了。。。。怎么办啊",Toast.LENGTH_SHORT).show();
                bar.setButtonVisible(CustomBar.RIGHT_BUT_ID,false);
            }
        });
    }
}
